package com.cs5103.project.calendar;

import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;

public class AgendaDialog extends DialogFragment {
	private static int titleResourceID;
	
	static AgendaDialog newInstance(int titleResourceString) {
		AgendaDialog dlg = new AgendaDialog();
		titleResourceID = titleResourceString;
		return dlg;
	}
	
	@Override
	public Dialog onCreateDialog(Bundle savedInstanceState) {
		AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());

		LayoutInflater inflater = (LayoutInflater)getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		View v = inflater.inflate(R.layout.agenda_dialog_layout, null);
		builder.setView(v);

		builder.setTitle(titleResourceID)
			.setIcon(R.drawable.ic_menu_agenda)
			.setTitle(titleResourceID)
			.setPositiveButton(R.string.buttonOK, 
				new DialogInterface.OnClickListener() {
					@Override
					public void onClick(DialogInterface dialog, int which) {
						
					}
				});
		
		return builder.create();
	}
}